package com.jt.redis;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;

public class JedisDataSource {
    private static final JedisPool jedisPool;
    private static final String HOST= "192.168.126.129";
    private static final int PORT=6379;
    static {
//        jedisPool = new JedisPool();
        JedisPoolConfig config = new JedisPoolConfig();
        config.setMaxTotal(16);
        config.setMaxIdle(60);
        jedisPool = new JedisPool(config,HOST,PORT);
    }

    public static Jedis getConnection(){
        return jedisPool.getResource();
    }


}
